package com.zhao.config;

import java.io.FileWriter;
import java.io.IOException;

/* *     http://localhost:8080/payment/pay
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117698022";

    // 商户私钥，您的PKCS8格式RSA2私钥 https://miniu.alipay.com/keytool/create 自己手动生成的私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCMIV429XZHLtbzTFNkIXptRwiszk3g5wY6rYqUTctkhXnG9rVq7q35Tqt8kY/Z8K6htX0g1uRWrK0pDYWUIxwv67ph34Tk1qUHyJZwuC9dFzg92ujiswejdpu7NERP4K8FE3bJVCKljQ8jhSue6b+9eCQKPTe8T0bdTD+4FFijeT6DUsWPirtjISHUXltzlCR0fv9YJJ9NtsojS7v80Lv23XL95hNENrxNIGeyhHb5r9vCNGFgn349lEKnwzLX352IleTiyqFfgQzqjpIHVXqbXwZXk/2DUSjiAoaQJw0DaJfcuknd2PIRGT+qrADjCogAODbrDEJWlnrhW0cUn6DHAgMBAAECggEAY05SYkhZ5eA/3HO+tTs0c7TfZPdfIX8XXwYVKzxmY3pj7qhvsLQs/nzN8p2FgEGcwGTJpDgl4XbF0E4Q2AZ5t0wq7allmHa0xWtVkdQ1XJdT+CHm4KFXTHSFsIk90A2+eq5shAjn9MKec+GwJBIrG67Ee60ejojwA2xBy8Y/erkmO2WHLnLQHNqCZUJSasZflx7klgxCw69QHmdL8wxDfPGfTqmumKmvB5Vx4cPCrvpFe5E+WmBviPPWprgDAAC5htLl07vYbvBuQp1NrkPNdBEfHe8ekJ0rwQjrpKXKHX7UW0znSJQf0bcD2dQjeZKI1OY6YyGkHwEQKTjARTLw4QKBgQDbmESvECNwIOEZsJSrevFhrHWaea2ZTRsiS7853ws8rdH79unDDZ68MPo0Z/OAlBQeUmkW6PpDq7NpNbQUfbi4yf8O9n77lOIobO/OLMOumTJKT8JFwy+A1O+UxYqBXvFZvIoy6YpKNfQFV0tqeflPn96bspPIHlUu5NhC9ewg+wKBgQCjXJTxD2kQ1VF518jDXhMVKrAlJRossm+rvCsb6R6Z+pd3/u6/MLSTj3U8DHhJyiRp0gDQH/HmweyrWduPi/toBWe8xhO19ZwQU9dtS6VVQiTeKohWzoIdW0v6pWiVxDW0pPRNmnFQI4N5gsI1izsN3u7gKEmE6NTY1r0J0dLtpQKBgCXE4stZcz7t6MmKXYfA9ZNfHjsbgohDgs87SACkJEKjguJbbYlm5k5n/iDVYERVM8CjW//cwm6xMYJ/AiIkHYlq9LuWGfEbgmqBkh1cBawaHVQ6s6dcEueNuEdWUqQ9uDU/AGYRVP++l+HzSb1ejUrsrFULOe/Jh80w/yFFOv/RAoGASecIOkWOcl8OjOBhooBcgabeKO+v96iBfF+T4PyFK4OCInbh6vxNtLOhhZjekgMwle67D2xkMtBoENyFx1q8UUKgu3WgVSDXiUtkmb0u/nL92sPDCgJCOqWiqbFKrvYklaRKIRFNUcO/JqlQ0og6HvxLdHzFRatPHwmGW3rgwUECgYA3UIhKu1IR1PWwZ1COla4aiJ1FEHsRWhNbYt/H8ZfIpTcpU+9Jmc26BW/7GlWyS/Rwi/J4a45vlnYTeraEUYH9cASvY84fz1hvb4ErRhjFcItUTnSHfG9K0ICBIUkefrDAf4gh6PqJ7TyKdi9MmCNlIj8k8yZNqZj4nlanNQVtsA==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAh/uyRmCkGokNl6Kp0wU2MuXd1h4sc5ESsx1/jMs06oPlx3VInfLNQax3D4GP438Mn1ky4QWVSoafhwGnKd7Xfua/e/2Ce6JGUr8iHD3SlSv+qeMPCkjkvgkseHABFRsuL9xMgJ7J0Xw7xLXS1SlQlQ62oi1G6GYeZaGE0FYrf4VxhjeP/uzX4vmE7QoRH+HlP4hOcVwyOlM3/1mpfdMNJe4FuANttuED8M+MPKb8Z9B0Jdfx3HUaD3QkZBMtyMwuYEhDV1NYhsArwtS6YM0eE3dvEy5mv71/i76125JFXGKR0w5oTmgwrpRtCPqtqiqCqTgOsi0JTy8GfcM7QwUBOQIDAQAB";
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问 我的是例子
    public static String notify_url = "http://j97im9.natappfree.cc/payment/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://j97im9.natappfree.cc/payment/notifyUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}


